int ParentNuclides(nuclide nuc)
{
//	double dkM[41] = 	{   1,    2,     3,     4,    5,     7,   8,1.11,1.41,1.51,1.5141, 1.52,1.53,1.54,1.91,1.92,2.21,2.41,2.71,2.7141,2.72,2.73,5.51, 5.52,7.71,9.10,9.11,9.12,9.13,9.14,9.15,9.20,9.21,9.23,9.30,9.40,9.50,9.60,9.70,9.80,9.90};
	int dkM[41] = 	{100, 200, 300, 400, 500, 700,800, 111, 141, 151, 151,     152, 153, 154, 191, 192, 221, 241, 271, 271,    272, 273, 551,  552, 771, 910, 911, 912, 913, 914, 915, 920, 921, 923, 930, 940, 950, 960, 970, 980, 990};
	int dkZ[41] = 	{  -1,     1,     0,    2,     0,    1,   1,    -2,     1,   -1,     1,       -1,   -1,    -1,    0,     0,    2,     3,     2,    4,        3,     4,    0,     0,    2,    6,     8,   10,   10,   10,   10,    6,   10,  12,     8,     9,  10,   12,   12,   14,   14};
	int dkA[41] = 	{   0,     0,     0,    4,     1,    1,   0,     0,     4,    1,     5,        2,    3,     4,    2,     3,    0,     4,     1,    5,        2,     3,    2,     3,    2,  12,    18,   20,   22,   25,  26,   14,   24,  28,   20,   23,  24,   28,   30,   32,   34};
	nuclide parent; decayInfo dau; int dax;
	int MatIx;
	MatIx = nuc.MaterialIndex;
	int liso;
	int dZ; dZ =  MatIx/10000;
	int dA; dA = (MatIx%10000)/10;
	int p=0;	// Number of parent nuclides
	int pZ; int pA;
	int dkx;
	for(dkx=0; dkx<41; dkx=dkx+1)
	{
		pZ = dZ + dkZ[dkx];
		pA = dA + dkA[dkx];
		for(liso=0;liso<4;liso=liso+1)
		{
			if (parent.Create(pZ, pA, liso)<0) break;
			for(dax=parent.DecayInfos-1; dax>=0; dax=dax-1)	// check all the parent daughters
			{
				dau = parent.DecayInfo(dax);
//				print("<tr><td>"+dax+" "+dau.DecayMode+"</td><td>"+parent.MaterialIndex+"</td><td>"+dau.Daughter+"</td><td>" + (dau.RTyp1*100+dau.RTyp2) + "</td></tr>");
				if (dau.Daughter == MatIx && dau.RTyp1*100+dau.RTyp2==dkM[dkx])	// it is the parent nuclide
				{
					string sQ = "&nbsp;";
					if (dau.Energy>=0) sQ = "" + dau.Energy;
					if (p==0) print("<tr><td><b>Type of Decay of "+nuc.IsotopeScreenFormat+"</b></td><td><b>Branching Ratio</b></td><td><b>Decay Energy, Q[MeV]</b></td><td><b>Parents</b></td></tr>");
 					print("<tr><td>"+dau.DecayMode+"</td><td>"+dau.BranchingRatio+"</td><td>" + sQ + "</td><td>"+parent.IsotopeScreenFormat+"</td></tr>");
					p=p+1;	// count the parents
					break;
				}
			}
		}
	}
	return p;	// number of parent nuclides
}

int main()
{
//	Edit the nuclide as you need:
//		1. parameter: chemical symbol or Z-Number e.g. "He" or 2 for helium
//		2. parameter: the Atomic Weight Number e.g. 4 for helium 4
//		3. parameter: the isomeric state number, 0 for ground, 1 for m,...
	nuclide nuc; 	
	nuc.Create("U", 236, 0);	// Create the desired Nuclide
	ParentNuclides(nuc);
}